In [1]:
import numpy as np
import os, sys
path = os.path.abspath('../library/')
if path not in sys.path:
    sys.path.append(path)
from convert_to_recarray import create_gdr2mock_mag_limited_survey

In [2]:
name = 'final'
create_gdr2mock_mag_limited_survey(nside = 512, outputDir = '../output/%s_100pc' %(name),
                                   use_previous = False, delete_ebf = True,
                                  fSample = 1, make_likelihood_asessment=False, r_max = 0.1,
                                  verbose = False)
create_gdr2mock_mag_limited_survey(nside = 512, outputDir = '../output/%s_0.001' %(name),
                                   use_previous = False, delete_ebf = True,
                                  fSample = 0.001, make_likelihood_asessment=False)


/home/rybizki/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
/home/rybizki/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
/home/rybizki/anaconda3/lib/python3.6/site-packages/sklearn/ensemble/weight_boosting.py:29: DeprecationWarning: numpy.core.umath_tests is an internal NumPy module and should not be imported. It will be removed in a future NumPy release.
  from numpy.core.umath_tests import inner1d
Galaxia spawns catalogue
########################################################################################
############################# GALAXIA OUTPUT END ##################
########################################################################################
373381
('rad', 'teff', 'vx', 'vy', 'vz', 'pz', 'px', 'py', 'feh', 'exbv_schlegel', 'lum', 'glon', 'glat', 'smass', 'age', 'grav', 'gaia_g', 'gaia_bpft', 'gaia_bpbr', 'gaia_rp', 'gaia_rvs', 'popid', 'mact')
converting to npy and appending ra and dec took 2.0 sec
0 373381
converting time and applying extinction map for 373381 sources in nside = 512 took 1.7 sec
indexing and remapping to isochrones took 2.9 sec
calculating extinction curve for all bands took 9.4 sec
373381
373276
calculated healpix
calculated pmdec pmra and rv
cleaning of data took 3.0 sec
plotting time took 1.4 sec
Total time in minutes: 0.7
Galaxia spawns catalogue
b'Galaxia-v0.81\nCODEDATAPATH=/home/rybizki/Programme/GalaxiaData/\nReading Parameter file-             ../output/final_0.001/GDR2mock_20.7Gmag.log\n--------------------------------------------------------\noutputFile               GDR2mock_20.7Gmag       \nmodelFile                Model/population_parameters_BGM_update.ebf\ncodeDataDir              /home/rybizki/Programme/GalaxiaData\noutputDir                ../output/final_0.001   \nphotoSys                 parsec1/GAIADR3         \nmagcolorNames            gaia_g,gaia_bpft-gaia_rp\nappMagLimits[0]          -1000.000000            \nappMagLimits[1]          20.700000               \nabsMagLimits[0]          -1000.000000            \nabsMagLimits[1]          1000.000000             \ncolorLimits[0]           -1000.000000            \ncolorLimits[1]           1000.000000             \ngeometryOption           0                       \nlongitude                0.000000                \nlatitude                 90.000000               \nsurveyArea               1000.000000             \nfSample                  0.001000                \npopID                    -1                      \nwarpFlareOn              1                       \nseed                     1                       \nr_max                    1000.000000             \nstarType                 0                       \nphotoError               0                       \n--------------------------------------------------------\nReading tabulated values from file- /home/rybizki/Programme/GalaxiaData/Model/vcirc.dat\nUsing geometry:                     All Sky\nReading Isochrones from dir-        /home/rybizki/Programme/GalaxiaData/Isochrones/padova/parsec1/GAIADR3\nzsol=0.0152\n/home/rybizki/Programme/GalaxiaData/Isochrones/padova/parsec1/GAIADR3\n13275 75 177\nIsochrone Grid Size:                (Age bins=177,Feh bins=75,Alpha bins=1)\nTime Isochrone Reading              1.22976     \nGenerating populations................\n--------------------------------------------------------\nThin disc sigma_v=[50, 32.3, 21, 0.33, 0.33]\n    [feh, dfeh]=[0.01, -0.12], [0.01, 0.18]\nThin Disk,ID=0:\nReading tree from file-             /home/rybizki/Programme/GalaxiaData/BHTree-2.3/bhtree_with_wf/bhtree_0_E1.ebf\nTime Tree generation/reading =      0.60054     \nCompleted % <0..10..20..30..40..50..60..70..80..90..>\nStars spawned =                     68930       \nTime Spawning=                      13.5415     \n--------------------------------------------------------\nThin disc sigma_v=[50, 32.3, 21, 0.33, 0.33]\n    [feh, dfeh]=[0.01, -0.12], [0.01, 0.18]\nThin Disk,ID=1:\nReading tree from file-             /home/rybizki/Programme/GalaxiaData/BHTree-2.3/bhtree_with_wf/bhtree_1_E1.ebf\nTime Tree generation/reading =      0.536949    \nCompleted % <0..9..19..29..39..49..59..69..79..89..99..>\nStars spawned =                     341894      \nTime Spawning=                      16.7414     \n--------------------------------------------------------\nThin disc sigma_v=[50, 32.3, 21, 0.33, 0.33]\n    [feh, dfeh]=[0.01, -0.12], [0.01, 0.18]\nThin Disk,ID=2:\nReading tree from file-             /home/rybizki/Programme/GalaxiaData/BHTree-2.3/bhtree_with_wf/bhtree_2_E1.ebf\nTime Tree generation/reading =      0.876178    \nCompleted % <0..9..19..29..39..49..59..69..79..89..99..>\nStars spawned =                     402616      \nTime Spawning=                      18.4471     \n--------------------------------------------------------\nThin disc sigma_v=[50, 32.3, 21, 0.33, 0.33]\n    [feh, dfeh]=[0.01, -0.12], [0.01, 0.18]\nThin Disk,ID=3:\nReading tree from file-             /home/rybizki/Programme/GalaxiaData/BHTree-2.3/bhtree_with_wf/bhtree_3_E1.ebf\nTime Tree generation/reading =      0.794519    \nCompleted % <0..9..19..29..39..49..59..69..79..89..99..>\nStars spawned =                     393733      \nTime Spawning=                      18.4576     \n--------------------------------------------------------\nThin disc sigma_v=[50, 32.3, 21, 0.33, 0.33]\n    [feh, dfeh]=[0.01, -0.12], [0.01, 0.18]\nThin Disk,ID=4:\nReading tree from file-             /home/rybizki/Programme/GalaxiaData/BHTree-2.3/bhtree_with_wf/bhtree_4_E1.ebf\nTime Tree generation/reading =      1.05281     \nCompleted % <0..9..19..29..39..49..59..69..79..89..99..>\nStars spawned =                     792932      \nTime Spawning=                      24.5199     \n--------------------------------------------------------\nThin disc sigma_v=[50, 32.3, 21, 0.33, 0.33]\n    [feh, dfeh]=[0.01, -0.12], [0.01, 0.18]\nThin Disk,ID=5:\nReading tree from file-             /home/rybizki/Programme/GalaxiaData/BHTree-2.3/bhtree_with_wf/bhtree_5_E1.ebf\nTime Tree generation/reading =      1.13645     \nCompleted % <0..9..19..29..39..49..59..69..79..89..99..>\nStars spawned =                     845645      \nTime Spawning=                      27.9559     \n--------------------------------------------------------\nThin disc sigma_v=[50, 32.3, 21, 0.33, 0.33]\n    [feh, dfeh]=[0.01, -0.12], [0.01, 0.18]\nThin Disk,ID=6:\nReading tree from file-             /home/rybizki/Programme/GalaxiaData/BHTree-2.3/bhtree_with_wf/bhtree_6_E1.ebf\nTime Tree generation/reading =      1.42594     \nCompleted % <0..9..19..29..39..49..59..69..79..89..99..>\nStars spawned =                     1176275     \nTime Spawning=                      44.2045     \n--------------------------------------------------------\nfeh=-0.17 sig_feh=0.27\nThick disc sigma_v=[67, 51, 42, 0.33, 0.33]\n    [feh, dfeh, age, dage]=[-0.48, 0.3, 1.1e+10, 1e+09]\nThickDisk:\nReading tree from file-             /home/rybizki/Programme/GalaxiaData/BHTree-2.3/bhtree_with_wf/bhtree_7_E0.ebf\nTime Tree generation/reading =      0.075502    \nCompleted % <0..9..19..29..39..49..59..69..79..89..99..>\nStars spawned =                     1215995     \nTime Spawning=                      10.2788     \n--------------------------------------------------------\nSpheroid sigma_v=[131, 106, 85]\n    [feh, dfeh, age, dage]=[-1.5, 0.5, 1.3e+10, 0]\nSpheroid:\nReading tree from file-             /home/rybizki/Programme/GalaxiaData/BHTree-2.3/bhtree_with_wf/bhtree_8_E0.ebf\nTime Tree generation/reading =      0.076854    \nCompleted % <0..9..19..29..39..49..59..69..79..89..99..>\nStars spawned =                     57378       \nTime Spawning=                      5.56176     \n--------------------------------------------------------\nBulge sigma_v=[113, 115, 100, 71.62]\n    [feh, dfeh, age, dage]=[0, 0.2, 1e+10, 0]\nBulge:\nReading tree from file-             /home/rybizki/Programme/GalaxiaData/BHTree-2.3/bhtree_with_wf/bhtree_9_E0.ebf\nTime Tree generation/reading =      0.97569     \nCompleted % <0..9..19..29..39..49..59..69..79..89..99..>\nStars spawned =                     1192144     \nTime Spawning=                      32.4654     \n--------------------------------------------------------\nTotal stars written                 6487542                 \nFile written-                       ../output/final_0.001//GDR2mock_20.7Gmag.ebf\nCalulating magnitudes................\nReading Isochrones from dir-        /home/rybizki/Programme/GalaxiaData/Isochrones/padova/parsec1/GAIADR3\nzsol=0.0152\n/home/rybizki/Programme/GalaxiaData/Isochrones/padova/parsec1/GAIADR3\n13275 75 177\nIsochrone Grid Size:                (Age bins=177,Feh bins=75,Alpha bins=1)\nTime Isochrone Reading              1.9442      \ngaia_g\ngaia_bpbr\ngaia_bpft\ngaia_rp\ngaia_rvs\nCalulating Extinction................\nTime for extinction calculation     2.29223     \nTotal Time=                         228.51      \n'
########################################################################################
############################# GALAXIA OUTPUT END ##################
########################################################################################
6487542
('rad', 'teff', 'vx', 'vy', 'vz', 'pz', 'px', 'py', 'feh', 'exbv_schlegel', 'lum', 'glon', 'glat', 'smass', 'age', 'grav', 'gaia_g', 'gaia_bpft', 'gaia_bpbr', 'gaia_rp', 'gaia_rvs', 'popid', 'mact')
converting to npy and appending ra and dec took 36.7 sec
0 6487542
1000000 6487542
2000000 6487542
3000000 6487542
4000000 6487542
5000000 6487542
6000000 6487542
converting time and applying extinction map for 6487542 sources in nside = 512 took 21.1 sec
indexing and remapping to isochrones took 42.8 sec
calculating extinction curve for all bands took 173.9 sec
6487542
1663424
calculated healpix
calculated pmdec pmra and rv
cleaning of data took 16.4 sec
/home/rybizki/Desktop/Galaxia_wrap-master/library/defaults.py:9: UserWarning: 
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

The backend was *originally* set to 'module://ipykernel.pylab.backend_inline' by the following code:
  File "/home/rybizki/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/rybizki/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 477, in start
    ioloop.IOLoop.instance().start()
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/zmq/eventloop/ioloop.py", line 177, in start
    super(ZMQIOLoop, self).start()
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 888, in start
    handler_func(fd_obj, events)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 440, in _handle_events
    self._handle_recv()
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 472, in _handle_recv
    self._run_callback(callback, msg)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 414, in _run_callback
    callback(*args, **kwargs)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 235, in dispatch_shell
    handler(stream, idents, msg)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 399, in execute_request
    user_expressions, allow_stdin)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/ipykernel/ipkernel.py", line 196, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/ipykernel/zmqshell.py", line 533, in run_cell
    return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2698, in run_cell
    interactivity=interactivity, compiler=compiler, result=result)
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2808, in run_ast_nodes
    if self.run_code(code, result):
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2862, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-c21c51b8ef21>", line 8, in <module>
    fSample = 0.001, make_likelihood_asessment=False)
  File "/home/rybizki/Desktop/Galaxia_wrap-master/library/convert_to_recarray.py", line 198, in create_gdr2mock_mag_limited_survey
    plot_sky_map(x,nside,fSample,appMagLimits1,outputDir,outputFile)
  File "/home/rybizki/Desktop/Galaxia_wrap-master/library/util.py", line 249, in plot_sky_map
    import matplotlib.pylab as plt
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/matplotlib/pylab.py", line 252, in <module>
    from matplotlib import cbook, mlab, pyplot as plt
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/matplotlib/pyplot.py", line 71, in <module>
    from matplotlib.backends import pylab_setup
  File "/home/rybizki/anaconda3/lib/python3.6/site-packages/matplotlib/backends/__init__.py", line 16, in <module>
    line for line in traceback.format_stack()


  matplotlib.use('Agg') ## use a non-interactive Agg background
total number of stars = 1663424000
0.0
1663424000.0128412
126843610227.43547
plotting time took 7.3 sec
Total time in minutes: 8.8

In [ ]: